<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "user".
 *
 * @property integer $id
 * @property string $username
 * @property string $icon
 * @property integer $sex
 * @property string $phone
 * @property string $signature
 * @property integer $age
 * @property integer $emotional
 * @property string $hometown
 * @property string $professional
 * @property integer $start
 * @property integer $carId
 * @property integer $userCardImg
 * @property integer $realStart
 * @property double $userMoney
 */
class User extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'user';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['username', 'realStart'], 'required'],
            [['sex', 'age', 'emotional', 'start', 'carId', 'userCardImg', 'realStart'], 'integer'],
            [['userMoney'], 'number'],
            [['username', 'hometown', 'professional'], 'string', 'max' => 32],
            [['icon', 'signature'], 'string', 'max' => 322],
            [['phone'], 'string', 'max' => 20],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'username' => 'Username',
            'icon' => 'Icon',
            'sex' => 'Sex',
            'phone' => 'Phone',
            'signature' => 'Signature',
            'age' => 'Age',
            'emotional' => 'Emotional',
            'hometown' => 'Hometown',
            'professional' => 'Professional',
            'start' => 'Start',
            'carId' => 'Car ID',
            'userCardImg' => 'User Card Img',
            'realStart' => 'Real Start',
            'userMoney' => 'User Money',
        ];
    }
}
